﻿using System;

using System.ServiceProcess;

using System.ComponentModel;

using System.Configuration.Install;

namespace SES_Server
{

    [RunInstaller(true)]

    public class IIS_SES_RelayServiceInstaller : Installer
    {

        private ServiceProcessInstaller IISSESRelayServiceProcessInstaller;

        private ServiceInstaller IISSESRelayServiceServiceInstaller;

        public IIS_SES_RelayServiceInstaller()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {

            this.IISSESRelayServiceProcessInstaller = new ServiceProcessInstaller();
            this.IISSESRelayServiceProcessInstaller.Account = ServiceAccount.LocalSystem;
            this.IISSESRelayServiceServiceInstaller = new ServiceInstaller();
            this.IISSESRelayServiceServiceInstaller.DisplayName = "Amazon SES SMTP Server";
            this.IISSESRelayServiceServiceInstaller.ServiceName = "Amazon SES SMTP Server";
            this.IISSESRelayServiceServiceInstaller.Description = "SMTP Server that acts as a SmartHost for IIS to relay emails to the Amazon Simple Email Service";
            this.IISSESRelayServiceServiceInstaller.StartType = ServiceStartMode.Automatic;
            this.Installers.AddRange(new Installer[] { this.IISSESRelayServiceProcessInstaller, this.IISSESRelayServiceServiceInstaller });

        }

    }

}